package org.wkg.lesson11;

import java.util.ArrayList;
import java.util.List;

public class Demo_1105 {

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            int j = i + 1;
            Thread thread = new Thread(() -> {
                list.add(j);
                System.out.println(list);
            });
            thread.start();
        }
    }
}
